The present invention relates to the art of image processing. It finds particular application in conjunction with gray level printers, and will be described with particular reference thereto. However, it is to be appreciated that the present invention is also amenable to other image rendering engines which produce gray level outputs and like applications.
At times, with bi-level image rendering, desired smooth edges appear stepped or jagged due to pixel size and/or limited resolution. One way to address this undesirable artifact is by supporting a number of intermediate tones or gray levels at selected pixel locations rather than simply one of the two relatively extreme intensity levels. Several mechanisms for producing the gray levels are available, including, e.g., modulation of the pixel pulse-width of a laser in a laser printing or rendering device. Regardless of how they are produced, the gray levels can be used to soften or ease the abrupt transitions between pixel rows and/or columns of an image edge, particularly in the case of diagonal edges. Instead of stepping directly from, for example, white to black in the span of a single pixel, the transition can be drawn out over a number of pixels which gradually progress through a sequence of grays. In this manner, the edge appears smoother. This technique for removing jagged edges or xe2x80x9cjaggiesxe2x80x9d is one form of anti-aliasing that makes lines and curves appear cleaner and smoother.
In the case then where one is working with a rendering engine that has the ability to produce a number of intermediate gray levels, the problem of determining which gray levels are to be rendered and which pixels are to be affected remains. Previously developed anti-aliasing edge-drawing algorithms are available which can produce the desired gray levels as part of the edge construction. However, this approach is limited insomuch as the image would have to be constructed for the particular rendering engine employed, and for the sake of compatibility with devices that do not support gray levels, it is desirable that the rendering engine accept the images without the gray level information. That is to say, one would like to use gray levels to enhance resolution, but to be able to deduce the specific manner of their use from examination of the bi-level image.
One known method address the problem at a confined local level. In this method, a local bounded window or tile is scanned across the image. At each location, the bitmap or pixel configuration within the window is compared to a collection of predefined specific patterns. When a match is found, the intensity levels of selected pixels within the window are adjusted to intermediate gray levels. Again, the approach is limited to localized smoothing insomuch as the effect cannot extend beyond the bounds of the window or the predefined pattern dimensions. For example, as depicted in FIG. 1, a diagonal edge having horizontal runs substantially longer than the dimensions of the window (while appearing smoothed at localized regions around the vertical jags) on the whole still appears stepped as the over all pattern characterizing the diagonal edge is beyond the scope of the window and/or predefined patterns.
Accordingly, the present invention contemplates a new and improved technique for anti-aliasing which overcomes the above-referenced problems and others.
In accordance with one aspect of the present invention, a method of smoothing edges of an input image is provided for use in connection with an image rendering engine that supports two opposing intensity levels and a range of intermediate intensity levels there between. The method includes sampling scan lines from the input: image. Each scan line includes an array of pixels, and each pixel possesses one of the two opposing intensity levels. Simultaneously a plurality of the scan lines are buffered. Thereafter, the method includes detecting defined patterns in an unbounded region within the buffered scan lines. Finally, intensity levels of selected pixels are adjusted to intermediate intensity levels in response to the defined patterns detected.
In accordance with another aspect of the present invention, a method of smoothing edges in a bi-level image is provided. The method includes reading a plurality of scan lines. Each scan line includes an array of pixels, and each pixel possesses one of two opposing intensity levels. In each scan line, the method includes determining lengths of runs of adjacent pixels having like intensity levels. Based upon the determined lengths of runs, a defined pattern is located within the scan lines, and in response to locating the defined pattern, intensity levels of selected pixels are adjusted to intermediate levels between the two opposing intensity levels.
In accordance with another aspect of the present invention, an image processing system includes an image input terminal which reads in an input image. An image processing unit samples scan lines from the input image and simultaneously stores a plurality of the scan lines in a buffer. Each scan line includes an array of pixels possessing one of two opposing intensity levels. The image processing unit detects patterns in the scan lines stored in the buffer. The patterns are defined by transition locations in the scan lines where pixels change intensity levels, and runs of arbitrary length where a number of adjacent pixels extending along the scan lines have like intensity levels. Furthermore, the image processing unit adjusts intensity levels of selected pixels to intermediate intensity levels between the two opposing intensity levels based on the patterns detected. An image output terminal which supports the two opposing intensity levels and the intermediate intensity levels renders scan lines output from the image processing unit in accordance with the intensity levels prescribed thereby.
One advantage of the present invention is that it produces images with smooth edges extending over non-localized regions.
Another advantage of the present invention is its compatibility with imaging processing and/or rendering devices that do not support gray levels.
Still further advantages and benefits of the present invention will become apparent to those of ordinary skill in the art upon reading and understanding the following detailed description of the preferred embodiments.